package com.grass.appointment.adapter;

import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.style.AbsoluteSizeSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.androidx.p013lv.base.Constance;
import com.androidx.p013lv.base.bean.TimeBean;
import com.androidx.p013lv.base.glide.GlideUtils;
import com.androidx.p013lv.base.interfaces.Key;
import com.androidx.p013lv.base.recycler.BaseRecyclerAdapter;
import com.androidx.p013lv.base.recycler.BaseRecyclerHolder;
import com.androidx.p013lv.base.utils.GlideEngine;
import com.androidx.p013lv.base.utils.PictureStyle;
import com.androidx.p013lv.base.utils.SpUtils;
import com.androidx.p013lv.base.utils.TimeUtils;
import com.androidx.p013lv.base.utils.UiUtils;
import com.androidx.p013lv.base.view.NoScrollGridView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestManager;
import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition;
import com.grass.appointment.C2694R;
import com.grass.appointment.bean.DynamicBean;
import com.luck.picture.lib.PictureSelector;
import com.luck.picture.lib.entity.LocalMedia;
import com.luck.picture.lib.style.PictureParameterStyle;
import java.util.ArrayList;
import java.util.List;

public class DynamicAdapter extends BaseRecyclerAdapter<DynamicBean, Holder> {
    String domain;
    Fragment fragment;
    boolean isMine;
    int itemHeight = ((((UiUtils.getWindowWidth() - UiUtils.dp2px(17)) / 2) * 223) / 165);
    int itemWidth = ((UiUtils.getWindowWidth() - UiUtils.dp2px(17)) / 2);

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public /* bridge */ /* synthetic */ void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int i, List list) {
        onBindViewHolder((Holder) viewHolder, i, (List<Object>) list);
    }

    public DynamicAdapter(Fragment fragment2, boolean z) {
        this.isMine = z;
        this.fragment = fragment2;
    }

    public String getDomain() {
        return this.domain;
    }

    public void setDomain(String str) {
        this.domain = str;
    }

    public void MyHolder(Holder holder, int i) {
        holder.setData((DynamicBean) getDataInPosition(i), i);
    }

    public void onViewRecycled(Holder holder) {
        super.onViewRecycled((RecyclerView.ViewHolder) holder);
        if (holder.iv_img != null) {
            Glide.with(this.fragment).clear(holder.iv_img);
        }
        if (holder.adapter != null) {
            holder.adapter = null;
        }
        if (holder.ic_cover != null) {
            Glide.with(this.fragment).clear(holder.ic_cover);
        }
        if (holder.iv_head != null) {
            Glide.with(this.fragment).clear(holder.iv_head);
        }
    }

    public void onBindViewHolder(Holder holder, int i, List<Object> list) {
        if (list.isEmpty()) {
            onBindViewHolder((BaseRecyclerHolder) holder, i);
        } else {
            holder.setItemData((DynamicBean) getDataInPosition(i));
        }
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public Holder onCreateViewHolder(ViewGroup viewGroup, int i) {
        return new Holder(LayoutInflater.from(viewGroup.getContext()).inflate(C2694R.C2699layout.item_dynamic, viewGroup, false));
    }

    /* access modifiers changed from: package-private */
    public class Holder extends BaseRecyclerHolder {
        DynamicItemAdapter adapter;
        TextView btn_attention;
        NoScrollGridView gridView;
        ImageView ic_cover;
        View include_audio_fiction;
        ImageView iv_audio_cover;
        ImageView iv_head;
        ImageView iv_img;
        ImageView iv_man_girl;
        ImageView iv_official;
        ImageView iv_play;
        ImageView iv_verify;
        ImageView iv_vip;
        LinearLayout ll_audio_layout;
        LinearLayout ll_head;
        LinearLayout ll_label_tag;
        LinearLayout ll_novel_label;
        LinearLayout ll_verify;
        RelativeLayout rl_cover_layout;
        TextView tv_address;
        TextView tv_approve;
        TextView tv_audio_title;
        TextView tv_btn_seeAll;
        TextView tv_comment;
        TextView tv_content;
        TextView tv_favorites_num;
        TextView tv_label1;
        TextView tv_label2;
        TextView tv_label3;
        TextView tv_listen_num;
        TextView tv_name;
        TextView tv_novel_label1;
        TextView tv_novel_label2;
        TextView tv_novel_label3;
        TextView tv_number;
        TextView tv_time;
        TextView tv_time_my;
        ImageView tv_top;
        TextView tv_verify;

        private Holder(View view) {
            super(view);
            this.gridView = (NoScrollGridView) view.findViewById(C2694R.C2697id.grid_view);
            this.rl_cover_layout = (RelativeLayout) view.findViewById(C2694R.C2697id.rl_cover_layout);
            this.ic_cover = (ImageView) view.findViewById(C2694R.C2697id.iv_cover);
            this.ll_head = (LinearLayout) view.findViewById(C2694R.C2697id.ll_head);
            this.tv_time_my = (TextView) view.findViewById(C2694R.C2697id.tv_time_my);
            this.iv_head = (ImageView) view.findViewById(C2694R.C2697id.iv_head);
            this.iv_official = (ImageView) view.findViewById(C2694R.C2697id.iv_official);
            this.iv_vip = (ImageView) view.findViewById(C2694R.C2697id.iv_vip);
            this.tv_name = (TextView) view.findViewById(C2694R.C2697id.tv_name);
            this.tv_address = (TextView) view.findViewById(C2694R.C2697id.tv_address);
            this.tv_time = (TextView) view.findViewById(C2694R.C2697id.tv_time);
            this.tv_top = (ImageView) view.findViewById(C2694R.C2697id.tv_top);
            this.tv_content = (TextView) view.findViewById(C2694R.C2697id.tv_content);
            this.tv_number = (TextView) view.findViewById(C2694R.C2697id.tv_number);
            this.tv_approve = (TextView) view.findViewById(C2694R.C2697id.tv_approve);
            this.tv_comment = (TextView) view.findViewById(C2694R.C2697id.tv_comment);
            this.iv_play = (ImageView) view.findViewById(C2694R.C2697id.iv_play);
            TextView textView = (TextView) view.findViewById(C2694R.C2697id.btn_attention);
            this.btn_attention = textView;
            textView.setOnClickListener(this);
            this.tv_approve.setOnClickListener(this);
            this.tv_comment.setOnClickListener(this);
            this.iv_head.setOnClickListener(this);
            this.ic_cover.setOnClickListener(this);
            this.iv_man_girl = (ImageView) view.findViewById(C2694R.C2697id.iv_man_girl);
            this.iv_img = (ImageView) view.findViewById(C2694R.C2697id.iv_img);
            this.ll_verify = (LinearLayout) view.findViewById(C2694R.C2697id.ll_verify);
            this.iv_verify = (ImageView) view.findViewById(C2694R.C2697id.iv_verify);
            this.tv_verify = (TextView) view.findViewById(C2694R.C2697id.tv_verify);
            this.tv_btn_seeAll = (TextView) view.findViewById(C2694R.C2697id.tv_btn_seeAll);
            this.ll_novel_label = (LinearLayout) view.findViewById(C2694R.C2697id.ll_novel_label);
            this.tv_novel_label1 = (TextView) view.findViewById(C2694R.C2697id.tv_novel_label1);
            this.tv_novel_label2 = (TextView) view.findViewById(C2694R.C2697id.tv_novel_label2);
            this.tv_novel_label3 = (TextView) view.findViewById(C2694R.C2697id.tv_novel_label3);
            this.include_audio_fiction = view.findViewById(C2694R.C2697id.include_audio_fiction);
            this.ll_audio_layout = (LinearLayout) view.findViewById(C2694R.C2697id.ll_audio_layout);
            this.iv_audio_cover = (ImageView) view.findViewById(C2694R.C2697id.iv_audio_cover);
            this.tv_audio_title = (TextView) view.findViewById(C2694R.C2697id.tv_audio_title);
            this.ll_label_tag = (LinearLayout) view.findViewById(C2694R.C2697id.ll_label_tag);
            this.tv_label1 = (TextView) view.findViewById(C2694R.C2697id.tv_label1);
            this.tv_label2 = (TextView) view.findViewById(C2694R.C2697id.tv_label2);
            this.tv_label3 = (TextView) view.findViewById(C2694R.C2697id.tv_label3);
            this.tv_listen_num = (TextView) view.findViewById(C2694R.C2697id.tv_listen_num);
            this.tv_favorites_num = (TextView) view.findViewById(C2694R.C2697id.tv_favorites_num);
            this.tv_btn_seeAll.setOnClickListener(this);
            this.tv_novel_label1.setOnClickListener(this);
            this.tv_novel_label2.setOnClickListener(this);
            this.tv_novel_label3.setOnClickListener(this);
            this.ll_audio_layout.setOnClickListener(this);
            this.iv_audio_cover.setOnClickListener(this);
        }

        public void setData(final DynamicBean dynamicBean, int i) {
            this.rl_cover_layout.setVisibility(0);
            if (DynamicAdapter.this.isMine) {
                this.ll_head.setVisibility(8);
                this.tv_time_my.setVisibility(0);
                if (dynamicBean.getStatus() == 0) {
                    this.ll_verify.setVisibility(0);
                    this.iv_verify.setImageResource(C2694R.C2696drawable.ic_verify_in);
                    this.tv_verify.setText("動態審核中，請耐心等待哦～");
                } else if (dynamicBean.getStatus() == 1) {
                    this.ll_verify.setVisibility(8);
                } else {
                    this.ll_verify.setVisibility(0);
                    this.iv_verify.setImageResource(C2694R.C2696drawable.ic_verify_out);
                    this.tv_verify.setText("審核失敗：" + dynamicBean.getNotPass());
                }
            } else {
                this.ll_head.setVisibility(0);
                this.tv_time_my.setVisibility(8);
                this.ll_verify.setVisibility(8);
            }
            if (SpUtils.getInstance().getUserInfo().getUserId() == dynamicBean.getUserId()) {
                this.btn_attention.setVisibility(8);
            } else {
                this.btn_attention.setVisibility(0);
            }
            if (dynamicBean.getDynamicType() == 1) {
                this.ic_cover.setVisibility(8);
                this.iv_play.setVisibility(8);
                if (dynamicBean.getDynamicImg() == null && dynamicBean.getDynamicImg().size() == 0) {
                    this.iv_img.setVisibility(8);
                    this.gridView.setVisibility(0);
                    DynamicItemAdapter dynamicItemAdapter = new DynamicItemAdapter(this.gridView.getContext(), DynamicAdapter.this.domain, new ArrayList());
                    this.adapter = dynamicItemAdapter;
                    this.gridView.setAdapter((ListAdapter) dynamicItemAdapter);
                } else {
                    int size = dynamicBean.getDynamicImg().size();
                    if (size == 1) {
                        this.iv_img.setVisibility(0);
                        this.gridView.setVisibility(8);
                        Glide.with(this.iv_img.getContext()).asBitmap().load(DynamicAdapter.this.domain + dynamicBean.getDynamicImg().get(0)).into(new CustomTarget<Bitmap>() {
                            /* class com.grass.appointment.adapter.DynamicAdapter.Holder.C27591 */

                            @Override // com.bumptech.glide.request.target.Target
                            public void onLoadCleared(Drawable drawable) {
                            }

                            @Override // com.bumptech.glide.request.target.Target
                            public /* bridge */ /* synthetic */ void onResourceReady(Object obj, Transition transition) {
                                onResourceReady((Bitmap) obj, (Transition<? super Bitmap>) transition);
                            }

                            public void onResourceReady(Bitmap bitmap, Transition<? super Bitmap> transition) {
                                int width = bitmap.getWidth();
                                int height = bitmap.getHeight();
                                ViewGroup.LayoutParams layoutParams = Holder.this.iv_img.getLayoutParams();
                                if (width > height) {
                                    layoutParams.width = Math.min(width, UiUtils.getScreenWidth() - UiUtils.dp2px(50));
                                } else {
                                    layoutParams.width = Math.min(width, (UiUtils.getScreenWidth() - UiUtils.dp2px(50)) / 2);
                                }
                                layoutParams.height = (layoutParams.width * height) / width;
                                Holder.this.iv_img.setLayoutParams(layoutParams);
                                Holder.this.iv_img.setImageBitmap(bitmap);
                                RequestManager with = Glide.with(Holder.this.iv_img.getContext());
                                with.load(DynamicAdapter.this.domain + dynamicBean.getDynamicImg().get(0)).into(Holder.this.iv_img);
                            }
                        });
                        this.iv_img.setOnClickListener(new View.OnClickListener() {
                            /* class com.grass.appointment.adapter.DynamicAdapter.Holder.View$OnClickListenerC27602 */

                            public void onClick(View view) {
                                ArrayList arrayList = new ArrayList();
                                LocalMedia localMedia = new LocalMedia();
                                localMedia.setPath(DynamicAdapter.this.domain + dynamicBean.getDynamicImg().get(0));
                                arrayList.add(localMedia);
                                PictureParameterStyle picturePreviewStyle = PictureStyle.getInstance(DynamicAdapter.this.fragment.getContext()).getPicturePreviewStyle();
                                picturePreviewStyle.f1970a = false;
                                PictureSelector.create(DynamicAdapter.this.fragment).setPictureStyle(picturePreviewStyle).isNotPreviewDownload(false).imageEngine(GlideEngine.createGlideEngine()).openExternalPreview(0, arrayList);
                            }
                        });
                    } else {
                        this.gridView.setVisibility(0);
                        this.iv_img.setVisibility(8);
                        if (size > 1 && size <= 4) {
                            this.gridView.setNumColumns(2);
                        } else if (size >= 5) {
                            this.gridView.setNumColumns(3);
                        }
                        DynamicItemAdapter dynamicItemAdapter2 = new DynamicItemAdapter(this.gridView.getContext(), DynamicAdapter.this.domain, dynamicBean.getDynamicImg());
                        this.adapter = dynamicItemAdapter2;
                        this.gridView.setAdapter((ListAdapter) dynamicItemAdapter2);
                    }
                }
            } else if (dynamicBean.getDynamicType() == 0) {
                this.gridView.setVisibility(8);
                this.iv_img.setVisibility(8);
                this.ic_cover.setVisibility(8);
                this.iv_play.setVisibility(8);
            } else {
                this.gridView.setVisibility(8);
                this.iv_img.setVisibility(8);
                this.ic_cover.setVisibility(0);
                this.iv_play.setVisibility(0);
                if (dynamicBean.getVideo() == null || dynamicBean.getVideo().getCoverImg() == null || dynamicBean.getVideo().getCoverImg().size() <= 0) {
                    ViewGroup.LayoutParams layoutParams = this.ic_cover.getLayoutParams();
                    layoutParams.width = DynamicAdapter.this.itemWidth;
                    layoutParams.height = DynamicAdapter.this.itemHeight;
                    this.ic_cover.setLayoutParams(layoutParams);
                    GlideUtils.loadPicDefault(this.ic_cover);
                } else {
                    ViewGroup.LayoutParams layoutParams2 = this.ic_cover.getLayoutParams();
                    int width = dynamicBean.getVideo().getWidth();
                    int height = dynamicBean.getVideo().getHeight();
                    float f = (float) width;
                    float screenWidth = f / ((float) (UiUtils.getScreenWidth() - UiUtils.dp2px(24)));
                    float f2 = (float) height;
                    float dp2px = f2 / ((float) UiUtils.dp2px(330));
                    if (width == 0 && height == 0) {
                        layoutParams2.width = DynamicAdapter.this.itemWidth;
                        layoutParams2.height = DynamicAdapter.this.itemHeight;
                    } else if (screenWidth >= 1.0f || dp2px >= 1.0f) {
                        if (screenWidth < dp2px) {
                            screenWidth = dp2px;
                        }
                        double d = (double) (f / screenWidth);
                        Double.isNaN(d);
                        double d2 = (double) (f2 / screenWidth);
                        Double.isNaN(d2);
                        layoutParams2.width = (int) ((float) (d + 0.5d));
                        layoutParams2.height = (int) ((float) (d2 + 0.5d));
                    } else {
                        layoutParams2.width = width;
                        layoutParams2.height = height;
                    }
                    this.ic_cover.setLayoutParams(layoutParams2);
                    GlideUtils.loadPicWh(DynamicAdapter.this.fragment, DynamicAdapter.this.domain + dynamicBean.getVideo().getCoverImg().get(0), this.ic_cover, layoutParams2.width, layoutParams2.height);
                }
            }
            GlideUtils.loadCirclePicHead(DynamicAdapter.this.fragment, DynamicAdapter.this.domain + dynamicBean.getLogo(), this.iv_head);
            this.tv_name.setText(dynamicBean.getNickName());
            if (TextUtils.isEmpty(dynamicBean.getCityName())) {
                this.tv_address.setText("小草星");
            } else {
                this.tv_address.setText(dynamicBean.getProvinceName() + "·" + dynamicBean.getCityName());
            }
            this.tv_time.setText(TimeUtils.utc2Common(dynamicBean.getCreatedAt()));
            TimeBean utc2appointment = TimeUtils.utc2appointment(dynamicBean.getCreatedAt());
            String timeText = utc2appointment.getTimeText();
            if (!TextUtils.isEmpty(timeText)) {
                this.tv_time_my.setText(timeText);
            } else {
                String str = utc2appointment.getDays() + "";
                String str2 = utc2appointment.getMonth() + "月";
                SpannableString spannableString = new SpannableString(str + str2);
                spannableString.setSpan(new AbsoluteSizeSpan(14, true), str.length(), str.length() + str2.length(), 33);
                this.tv_time_my.setText(spannableString);
            }
            if (dynamicBean.isTopDynamic()) {
                this.tv_top.setVisibility(0);
                this.tv_content.setText("              " + dynamicBean.getContent());
            } else {
                this.tv_top.setVisibility(8);
                this.tv_content.setText(dynamicBean.getContent());
            }
            this.tv_number.setText(dynamicBean.getFakeWatchTimes() + "人看過");
            if (dynamicBean.isLike()) {
                this.tv_approve.setCompoundDrawablesWithIntrinsicBounds(DynamicAdapter.this.fragment.getResources().getDrawable(C2694R.C2696drawable.ic_approve_btn), (Drawable) null, (Drawable) null, (Drawable) null);
            } else {
                this.tv_approve.setCompoundDrawablesWithIntrinsicBounds(DynamicAdapter.this.fragment.getResources().getDrawable(C2694R.C2696drawable.ic_approve_btn_no), (Drawable) null, (Drawable) null, (Drawable) null);
            }
            if (dynamicBean.getFakeLikes() < 0) {
                this.tv_approve.setText("0");
            } else {
                this.tv_approve.setText(dynamicBean.getFakeLikes() + "");
            }
            this.tv_comment.setText(dynamicBean.getCommentNum() + "");
            if (dynamicBean.isAttention()) {
                this.btn_attention.setText("已關注");
                this.btn_attention.setTextColor(Color.parseColor("#3EC67F"));
            } else {
                this.btn_attention.setText("關注");
                this.btn_attention.setTextColor(Color.parseColor("#ffffff"));
            }
            if (dynamicBean.getGender() == 1) {
                this.iv_man_girl.setImageResource(C2694R.C2696drawable.ic_girl);
            } else if (dynamicBean.getGender() == 2) {
                this.iv_man_girl.setImageResource(C2694R.C2696drawable.ic_man);
            } else {
                this.iv_man_girl.setImageResource(C2694R.C2696drawable.ic_man_girl);
            }
            if (dynamicBean.isOfficial()) {
                this.iv_official.setVisibility(0);
            } else {
                this.iv_official.setVisibility(8);
            }
            if (dynamicBean.isVip()) {
                this.iv_vip.setVisibility(0);
            } else {
                this.iv_vip.setVisibility(8);
            }
            this.include_audio_fiction.setVisibility(8);
            this.tv_btn_seeAll.setVisibility(8);
            this.tv_novel_label1.setVisibility(8);
            this.tv_novel_label2.setVisibility(8);
            this.tv_novel_label3.setVisibility(8);
            if (3 == dynamicBean.getDynamicType()) {
                this.rl_cover_layout.setVisibility(8);
                this.tv_btn_seeAll.setVisibility(0);
                this.include_audio_fiction.setVisibility(8);
                this.ll_novel_label.setVisibility(8);
                if (dynamicBean.getFictionChapterBase() != null) {
                    List<DynamicBean.FictionChapterBases.TagListBean> tagList = dynamicBean.getFictionChapterBase().getTagList();
                    if (!(dynamicBean.getFictionChapterBase() == null || tagList == null || tagList.size() <= 0)) {
                        this.ll_novel_label.setVisibility(0);
                        if (tagList.get(0) != null) {
                            this.tv_novel_label1.setText(tagList.get(0).getTitle() + "");
                            this.tv_novel_label1.setVisibility(0);
                            this.tv_novel_label1.setOnClickListener(new View.OnClickListener() {
                                /* class com.grass.appointment.adapter.DynamicAdapter.Holder.View$OnClickListenerC27613 */

                                public void onClick(View view) {
                                    ARouter.getInstance().build(Constance.FICTION_LABEL_ACTIVITY).withString(Key.TITLE, dynamicBean.getFictionChapterBase().getTagList().get(0).getTitle()).withInt("tagId", dynamicBean.getFictionChapterBase().getTagList().get(0).getTagId()).navigation();
                                }
                            });
                        }
                        if (tagList.size() > 1 && tagList.get(1) != null) {
                            this.tv_novel_label2.setText(tagList.get(1).getTitle() + "");
                            this.tv_novel_label2.setVisibility(0);
                            this.tv_novel_label2.setOnClickListener(new View.OnClickListener() {
                                /* class com.grass.appointment.adapter.DynamicAdapter.Holder.View$OnClickListenerC27624 */

                                public void onClick(View view) {
                                    ARouter.getInstance().build(Constance.FICTION_LABEL_ACTIVITY).withString(Key.TITLE, dynamicBean.getFictionChapterBase().getTagList().get(1).getTitle()).withInt("tagId", dynamicBean.getFictionChapterBase().getTagList().get(1).getTagId()).navigation();
                                }
                            });
                        }
                        if (tagList.size() > 2 && tagList.get(2) != null) {
                            this.tv_novel_label3.setText(tagList.get(2).getTitle() + "");
                            this.tv_novel_label3.setVisibility(0);
                            this.tv_novel_label3.setOnClickListener(new View.OnClickListener() {
                                /* class com.grass.appointment.adapter.DynamicAdapter.Holder.View$OnClickListenerC27635 */

                                public void onClick(View view) {
                                    ARouter.getInstance().build(Constance.FICTION_LABEL_ACTIVITY).withString(Key.TITLE, dynamicBean.getFictionChapterBase().getTagList().get(2).getTitle()).withInt("tagId", dynamicBean.getFictionChapterBase().getTagList().get(2).getTagId()).navigation();
                                }
                            });
                        }
                    }
                } else {
                    return;
                }
            }
            this.include_audio_fiction.setVisibility(8);
            this.tv_label1.setVisibility(8);
            this.tv_label2.setVisibility(8);
            this.tv_label3.setVisibility(8);
            if (4 == dynamicBean.getDynamicType()) {
                this.include_audio_fiction.setVisibility(0);
                this.rl_cover_layout.setVisibility(8);
                this.gridView.setVisibility(8);
                this.iv_img.setVisibility(8);
                this.ic_cover.setVisibility(8);
                this.iv_play.setVisibility(8);
                this.ll_label_tag.setVisibility(8);
                if (dynamicBean.getFictionChapterBase() != null) {
                    GlideUtils.loadPicWh(DynamicAdapter.this.fragment, DynamicAdapter.this.domain + dynamicBean.getFictionChapterBase().getCoverImg(), this.iv_audio_cover, 600, 600);
                    this.tv_audio_title.setText(dynamicBean.getFictionChapterBase().getChapterTitle() + "");
                    this.tv_listen_num.setText(UiUtils.num2str(dynamicBean.getFictionChapterBase().getFakeWatchTimes()) + "");
                    this.tv_favorites_num.setText(UiUtils.num2str(dynamicBean.getFictionChapterBase().getFakeLikes()) + "");
                    final List<DynamicBean.FictionChapterBases.TagListBean> tagList2 = dynamicBean.getFictionChapterBase().getTagList();
                    if (dynamicBean.getFictionChapterBase() != null && tagList2 != null && tagList2.size() > 0) {
                        this.ll_label_tag.setVisibility(0);
                        if (tagList2.get(0) != null) {
                            this.tv_label1.setText(tagList2.get(0).getTitle() + "");
                            this.tv_label1.setVisibility(0);
                            this.tv_label1.setOnClickListener(new View.OnClickListener() {
                                /* class com.grass.appointment.adapter.DynamicAdapter.Holder.View$OnClickListenerC27646 */

                                public void onClick(View view) {
                                    ARouter.getInstance().build(Constance.VOICE_NOVEL_LABEL_ACTIVITY).withString(Key.TITLE, ((DynamicBean.FictionChapterBases.TagListBean) tagList2.get(0)).getTitle()).withInt("tagId", ((DynamicBean.FictionChapterBases.TagListBean) tagList2.get(0)).getTagId()).navigation();
                                }
                            });
                        }
                        if (tagList2.size() > 1 && tagList2.get(1) != null) {
                            this.tv_label2.setText(tagList2.get(1).getTitle() + "");
                            this.tv_label2.setVisibility(0);
                            this.tv_label2.setOnClickListener(new View.OnClickListener() {
                                /* class com.grass.appointment.adapter.DynamicAdapter.Holder.View$OnClickListenerC27657 */

                                public void onClick(View view) {
                                    ARouter.getInstance().build(Constance.VOICE_NOVEL_LABEL_ACTIVITY).withString(Key.TITLE, ((DynamicBean.FictionChapterBases.TagListBean) tagList2.get(1)).getTitle()).withInt("tagId", ((DynamicBean.FictionChapterBases.TagListBean) tagList2.get(1)).getTagId()).navigation();
                                }
                            });
                        }
                        if (tagList2.size() > 2 && tagList2.get(2) != null) {
                            this.tv_label3.setText(tagList2.get(2).getTitle() + "");
                            this.tv_label3.setVisibility(0);
                            this.tv_label3.setOnClickListener(new View.OnClickListener() {
                                /* class com.grass.appointment.adapter.DynamicAdapter.Holder.View$OnClickListenerC27668 */

                                public void onClick(View view) {
                                    ARouter.getInstance().build(Constance.VOICE_NOVEL_LABEL_ACTIVITY).withString(Key.TITLE, ((DynamicBean.FictionChapterBases.TagListBean) tagList2.get(2)).getTitle()).withInt("tagId", ((DynamicBean.FictionChapterBases.TagListBean) tagList2.get(2)).getTagId()).navigation();
                                }
                            });
                        }
                    }
                }
            }
        }

        /* access modifiers changed from: package-private */
        public void setItemData(DynamicBean dynamicBean) {
            if (dynamicBean.isLike()) {
                this.tv_approve.setCompoundDrawablesWithIntrinsicBounds(DynamicAdapter.this.fragment.getResources().getDrawable(C2694R.C2696drawable.ic_approve_btn), (Drawable) null, (Drawable) null, (Drawable) null);
            } else {
                this.tv_approve.setCompoundDrawablesWithIntrinsicBounds(DynamicAdapter.this.fragment.getResources().getDrawable(C2694R.C2696drawable.ic_approve_btn_no), (Drawable) null, (Drawable) null, (Drawable) null);
            }
            if (dynamicBean.getFakeLikes() < 0) {
                this.tv_approve.setText("0");
            } else {
                TextView textView = this.tv_approve;
                textView.setText(dynamicBean.getFakeLikes() + "");
            }
            if (dynamicBean.isAttention()) {
                this.btn_attention.setText("已關注");
                this.btn_attention.setTextColor(Color.parseColor("#3EC67F"));
                return;
            }
            this.btn_attention.setText("關注");
            this.btn_attention.setTextColor(Color.parseColor("#ffffff"));
        }
    }
}
